<?php

declare(strict_types=1);

use app\middleware\AuthTokenMiddleware;
use app\middleware\PermissionMiddleware;
use think\facade\Route;

Route::group('admin', function () {
    Route::resource('document', '\module\document\controller\admin\Document');
})->middleware([
    AuthTokenMiddleware::class,
    PermissionMiddleware::class
]);

Route::group('index', function () {
    Route::get('page/:name', '\module\document\controller\Index@page');
    Route::get('list/:type', '\module\document\controller\Index@list');
    Route::get(':id', '\module\document\controller\Index@read');
});